<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>工艺配方</title>
    <script src="../Public/publicjs.js"></script>
    <script type="text/javascript" src="../Public/DateFormat.js"></script>
    <script src="../Uom/UomChose.js"></script>
    <script src="../Public/ibcpSelectProduct.js"></script>
    <script type="text/javascript" src="Recipe.js"></script>
    <style type="text/css">
        html {
            width: 100%;
            height: 100%;
        }
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }
        #leftSide,#rightSide {
            height: 100%;
            margin: 0;
            padding: 0;
        }
        .form-group{
            margin-bottom: 3px;
        }
        #box1,#box2, #box3 {
            display: none;
            padding-top: 2px;
        }
        .slide {
            margin: 0;
            padding: 0;
            cursor: pointer;
        }
        .btn-slide {
            background: #009688;
            height: 40px;
            padding: 0 10px 0 0;
            margin: 0 auto;
            display: block;
            font-size: 16px;
            color: #fff;
            line-height: 40px;
            border: 0px solid #009688;
            border-radius: 6px;
        }
        .btn-slide span {
            margin: 8px;
        }
        #recipeResultTable td {
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }
    </style>

</head>
<body>
    <div id="leftSide" class="panel panel-default col-md-3" style="height: 100%;padding-bottom: 0;">
        <div class="panel-heading">
            <h2><span class="label label-custom">查找工艺配方</span></h2>
        </div>
        <div class="panel-body" style="padding-bottom: 0;">
            <div style="padding-bottom: 10px">
                <div class="col-md-9" style="padding-left: 0">
                    <input type="text" class="form-control" id="searchText" placeholder="请输入代码/名称并以空格分开" style="display: inline">
                </div>
                <div class="col-md-3"  style="padding: 0;text-align: center;">
                    <button type="button" id="searchBtn" class="btn btn-custom" style="width: 100%;display: inline;">搜索</button>
                </div>
            </div>
            <br />
            <div style="margin-top: 10px">
                <table id="recipeResultTable" class="bootstrap-table table"
                       data-toggle="table"
                       data-click-to-select="true"
                       data-striped="true"
                       data-row-style="setUneffectiveRow"
                       data-unique-id="id"
                       data-cell-style="cellStyle"  style="padding-top: 10px;overflow-y: scroll;table-layout: fixed">
                    <thead>
                        <tr>
                            <th data-field="state" data-radio="true"></th>
                            <th data-field="id" data-visible="false"></th>
                            <th data-field="pathId" data-visible="false"></th>
                            <th data-field="code">代码</th>
                            <th data-field="name">名称</th>
                            <th data-field="version">版本</th>
                            <th data-field="statusName">状态</th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
    <div id="rightSide" class="col-md-9" style="height: 100%;padding: 0;">
        <div id="contain1" class="panel panel-default" style="margin-top: 0px">
            <div class="panel-heading col-md-12">
                <h2 class="col-md-3" style="padding: 0"><span class="label label-custom">工艺配方基本信息</span></h2>
                <div class="col-md-9">
                    <div class="btn-toolbar" style="float: right;margin-right: 5px">
                        <button type="button" id="addRecipe" class="btn btn-custom" data-toggle="tooltip" data-placement="bottom" title="新增工艺配方"><span class="glyphicon glyphicon-plus"></span></button>
                        <button type="button" id="copyRecipe" class="btn btn-custom" data-toggle="tooltip" data-placement="bottom" title="拷贝工艺配方"><span class="glyphicon glyphicon-file"></span></button>
                        <button type="button" id="deleteRecipe" class="btn btn-danger" data-toggle="tooltip" data-placement="bottom" title="删除工艺配方" onclick="deleteRecipe()"><span class="glyphicon glyphicon-trash"></span></button>
                        <button type="button" id="versionRecipe" class="btn btn-custom" data-toggle="tooltip" data-placement="bottom" title="工艺配方当前版本"><span class="glyphicon glyphicon-eye-open"></span></button>
                        <button type="button" id="versionHistory" class="btn btn-custom" data-toggle="tooltip" data-placement="bottom" title="工艺配方版本历史"><span class="glyphicon glyphicon-calendar"></span></button>
                        <button type="button" id="versionChange" class="btn btn-custom" data-toggle="tooltip" data-placement="bottom" title="工艺配方版本变更"><span class="glyphicon glyphicon-transfer"></span></button>
                        <button type="button" id="versionUpdata" class="btn btn-custom" data-toggle="tooltip" data-placement="bottom" title="工艺配方版本升级"><span class="glyphicon glyphicon-arrow-up"></span></button>
                        <button type="button" id="editRecipe" class="btn btn-custom" data-toggle="tooltip" data-placement="bottom" title="编辑工艺配方"><span class="glyphicon glyphicon-pencil"></span></button>
                    </div>
                </div>
            </div>
            <div class="panel-body" style="padding: 0;">
                <div id="info1" class="col-md-12" style="margin: 4px 0 0 0">
                    <div class ="form-group col-md-3 has-feedback">
                        <div class="input-group">
                            <div class="input-group-addon">代码</div>
                            <input type="text" class="form-control " id="recipeCode" readonly>
                        </div>
                    </div>
                    <div class ="form-group col-md-3 has-feedback">
                        <div class="input-group">
                            <div class="input-group-addon">名称</div>
                            <input type="text" class="form-control " id="recipeName" readonly>
                        </div>
                    </div>
                    <div class ="form-group col-md-3 has-feedback">
                        <div class="input-group">
                            <div class="input-group-addon">单位</div>
                            <input type="text" class="form-control " id="recipeUnit" readonly>
                        </div>
                    </div>
                    <div class ="form-group col-md-3 has-feedback">
                        <div class="input-group">
                            <div class="input-group-addon">状态</div>
                            <input type="text" class="form-control " id="status" readonly>
                        </div>
                    </div>
                </div>
                <div id="info2" class="col-md-12" style="margin: 4px 0 0 0">
                    <div class ="form-group col-md-3 has-feedback">
                        <div class="input-group">
                            <div class="input-group-addon">最小批量</div>
                            <input type="text" class="form-control " id="minBatch" readonly>
                        </div>
                    </div>
                    <div class ="form-group col-md-3 has-feedback">
                        <div class="input-group">
                            <div class="input-group-addon">批量</div>
                            <input type="text" class="form-control " id="recipeBatch" readonly>
                        </div>
                    </div>
                    <div class ="form-group col-md-3 has-feedback">
                        <div class="input-group">
                            <div class="input-group-addon">最大批量</div>
                            <input type="text" class="form-control " id="maxBatch" readonly>
                        </div>
                    </div>
                    <div class ="form-group col-md-3 has-feedback">
                        <div class="input-group">
                            <div class="input-group-addon">版本信息</div>
                            <input type="text" class="form-control " id="versionInfo" readonly>
                        </div>
                    </div>
                </div>
                <div id="info3" class="col-md-12" style="margin: 4px 0 0 0">
                    <div class ="form-group col-md-3 has-feedback">
                        <div class="input-group">
                            <div class="input-group-addon">产品代码</div>
                            <input type="text" class="form-control " id="produCode" readonly>
                        </div>
                    </div>
                    <div class ="form-group col-md-3 has-feedback">
                        <div class="input-group">
                            <div class="input-group-addon">产品名称</div>
                            <input type="text" class="form-control " id="produName" readonly>
                        </div>
                    </div>
                    <div class ="form-group col-md-3 has-feedback">
                        <div class="input-group">
                            <div class="input-group-addon">产品规格</div>
                            <input type="text" class="form-control " id="produStandar" readonly>
                        </div>
                    </div>
                    <div class ="form-group col-md-3 has-feedback">
                        <div class="input-group">
                            <div class="input-group-addon">注册登记号</div>
                            <input type="text" class="form-control " id="registNo" readonly>
                        </div>
                    </div>
                </div>
                <div id="info4" class="col-md-12" style="margin: 4px 0 0 0">
                    <div class ="form-group col-md-12 has-feedback">
                        <div class="input-group">
                            <div class="input-group-addon">备注</div>
                            <textarea id="remark" class="form-control" cols="30" rows="2" readonly="true"></textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="contain2" class="panel panel-default" style="margin-bottom: 0px;overflow: hidden;">
            <div class="panel-heading">
                <h2><span class="label label-custom">工艺配方综合信息</span></h2>
            </div>
            <div class="panel-body" style="padding-left: 16px;padding-bottom: 0;">
                <div id="content" style="overflow-y: auto;overflow-x: hidden;height: 700px;">
                    <div id="BOM" class="col-md-12" style="margin-bottom: 5px;padding-right: 3px;">
                        <div class="slide"><p class="btn-slide"><span class="glyphicon glyphicon-triangle-bottom"></span>BOM详细信息</p></div>
                        <div id="box2">
                            <div id="recipeBOM">
                                <div class="panel panel-default" style="margin: 0">
                                    <div class="panel-heading">
                                        <div style="margin: 0">
                                            <h2 style="padding: 0"><span class="label label-custom">基本信息</span></h2>
                                        </div>
                                    </div>
                                    <div class="panel-body" style="padding-bottom: 0px">
                                        <div style="margin-bottom: 5px">
                                            <div class="row">
                                                <div class="form-group col-md-4 has-feedback">
                                                    <div class="input-group">
                                                        <span  class="input-group-addon">产品代码</span >
                                                        <input id="productCode" class="form-control" type="text" readonly="readonly">
                                                    </div>
                                                </div>
                                                <div class="form-group col-md-4 has-feedback">
                                                    <div class="input-group">
                                                        <span  class="input-group-addon">产品名称</span >
                                                        <input id="productName" class="form-control" type="text" readonly="readonly">
                                                    </div>
                                                </div>
                                                <div class="form-group col-md-4 has-feedback">
                                                    <div class="input-group">
                                                        <span  class="input-group-addon">版本</span >
                                                        <input id="productVersion" class="form-control" type="text" readonly="readonly">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row" style="margin-top: 5px;">
                                                <div class="form-group col-md-12 has-feedback">
                                                    <div class="input-group">
                                                        <span  class="input-group-addon">备注</span >
                                                        <textarea id="productComment" class="form-control" cols="30" rows="2" readonly="readonly"></textarea>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="panel panel-default" style="margin: 8px 0 0 0;">
                                    <div class="panel-heading">
                                        <div style="margin: 0">
                                            <h2 style="padding: 0"><span class="label label-custom">物料列表</span></h2>
                                        </div>
                                    </div>
                                    <div class="panel-body" style="padding-bottom: 0">
                                        <div id="materialTableParent">
                                            <table id="materialTable" data-toggle="table"
                                                   data-click-to-select="true"
                                                   data-striped="true"
                                                   data-row-style="rowStyle"
                                                   data-cell-style="cellStyle"
                                                   data-unique-id="itemCode">
                                                <thead>
                                                <tr>
                                                    <th data-field="bomId" data-visible="false"></th>
                                                    <th data-field="itemCode">编号</th>
                                                    <th data-field="code">物料代码</th>
                                                    <th data-field="name">物料名称</th>
                                                    <th data-field="quantity">数量</th>
                                                    <th data-field="uomEngName">单位</th>
                                                    <th data-field="inDepc">是否固定数量</th>
                                                </tr>
                                                </thead>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="recipePath" class="col-md-12" style="margin-bottom: 5px;padding-right: 3px;">
                        <div class="slide"><p class="btn-slide"><span class="glyphicon glyphicon-triangle-bottom"></span>工艺路径信息</p></div>
                        <div id="box1">
                            <div id="craftPath">
                                <div class="panel panel-default" style="margin: 0">
                                    <div class="panel-heading">
                                        <div style="margin: 0">
                                            <h2 style="padding: 0"><span class="label label-custom">基本信息</span></h2>
                                        </div>
                                    </div>
                                    <div class="panel-body" style="padding-bottom: 0px">
                                        <div style="margin-bottom: 5px">
                                            <div class="row">
                                                <div class="form-group col-md-4 has-feedback">
                                                    <div class="input-group">
                                                        <span  class="input-group-addon">代码</span >
                                                        <input id="craftCode" class="form-control" type="text" readonly="readonly">
                                                    </div>
                                                </div>
                                                <div class="form-group col-md-4 has-feedback">
                                                    <div class="input-group">
                                                        <span  class="input-group-addon">名称</span >
                                                        <input id="craftName" class="form-control" type="text" readonly="readonly">
                                                    </div>
                                                </div>
                                                <div class="form-group col-md-4 has-feedback">
                                                    <div class="input-group">
                                                        <span  class="input-group-addon">版本</span >
                                                        <input id="craftVersion" class="form-control" type="text" readonly="readonly">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row" style="margin-top: 3px;">
                                                <div class="form-group col-md-12 has-feedback">
                                                    <div class="input-group">
                                                        <span  class="input-group-addon">备注</span >
                                                        <textarea id="craftComment" class="form-control" cols="30" rows="3" readonly=""true></textarea>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="panel panel-default" style="margin: 8px 0 0 0;">
                                    <div class="panel-heading">
                                        <div style="margin: 0">
                                            <h2 style="padding: 0"><span class="label label-custom">工艺路径图</span></h2>
                                        </div>
                                    </div>
                                    <div class="panel-body" style="padding-bottom: 0">
                                        <iframe id="craftPic" style="width:100%;margin-bottom: 5px;"></iframe>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div id="MFCinfo" class="col-md-12" style="margin-bottom: 5px;padding-right: 3px;">
                        <div class="slide">
                            <p class="btn-slide"><span class="glyphicon glyphicon-triangle-top glyphicon-triangle-bottom"></span>MFC</p>
                        </div>
                        <div id="box3"  style="display: block;">
                            <div id="MFC_Info">
                                <div class="panel panel-default" style="margin: 0">
                                    <div class="panel-heading">
                                        <div class="row" style="margin: 0">
                                            <h2 class="col-sm-4" style="padding: 0"><span class="label label-custom">MFC信息列表</span></h2>
                                            <div class="col-sm-8" style="padding:0px">
                                                <div class="btn-toolbar" style="float: right;margin-right: 10px">
                                                    <button id="MFC_IN_Add" type="button" class="btn btn-custom" data-toggle="tooltip" data-placement="bottom" title="流入项新增"><span class="glyphicon glyphicon-plus no-change"/>流入项</button>
                                                    <button id="MFC_TM_Add" type="button" class="btn btn-custom" data-toggle="tooltip" data-placement="bottom" title="流转项新增"><span class="glyphicon glyphicon-plus no-change"/>流转项</button>
                                                    <button id="MFC_OT_Add" type="button" class="btn btn-custom" data-toggle="tooltip" data-placement="bottom" title="流出项新增"><span class="glyphicon glyphicon-plus no-change"/>流出项</button>
                                                    <button id="MFC_Edit" type="button" class="btn btn-custom" data-toggle="tooltip" data-placement="bottom" title="编辑"><span class="glyphicon glyphicon-pencil no-change"/></button>
                                                    <button id="MFC_Delete" type="button" class="btn btn-danger" data-toggle="tooltip" data-placement="bottom" title="删除"><span class="glyphicon glyphicon-trash no-change"/></button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="panel-body" style="padding-bottom: 0px">
                                        <table id="mfcList" class="bootstrap-table table"
                                               data-toggle="table"
                                               data-click-to-select="true"
                                               data-striped="true"
                                               data-row-style="SetProRowStyle"
                                               data-cell-style="cellStyle"
                                               data-unique-id = "id"
                                               style="padding-top: 10px;overflow-y: scroll;table-layout:fixed">
                                            <thead>
                                            <tr>
                                                <th data-field="state" data-radio="true"></th>
                                                <th data-field="id" data-visible="false"></th>
                                                <th data-field="type" data-visible="false"></th>
                                                <th data-field="mfcNo">编号</th>
                                                <th data-field="itemCode">BOM物料项编号</th>
                                                <th data-field="preOpName">前操作</th>
                                                <th data-field="sucOpName">后操作</th>
                                            </tr>
                                            </thead>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</body>
<script>
    // 按钮下显示提示
    $(function () { $("[data-toggle='tooltip']").tooltip(); });
    // 折叠效果
    $(document).ready(function() {
        $("#recipePath .btn-slide").click(function() {
            $("#box1").slideToggle("slow");
            $("#recipePath .glyphicon").toggleClass("glyphicon-triangle-top");
            $("#recipePath .glyphicon").animate({opacity:"0"},200);
            $("#recipePath .glyphicon").animate({opacity:"1"},1100);
            return false;
        });
        $("#BOM .btn-slide").click(function() {
            $("#box2").slideToggle("slow");
            $("#BOM .glyphicon").toggleClass("glyphicon-triangle-top");
            $("#BOM .glyphicon").animate({opacity:"0"},200);
            $("#BOM .glyphicon").animate({opacity:"1"},1100);
            return false;
        });
        $("#MFCinfo .btn-slide").click(function() {
            $("#box3").slideToggle("slow");
            $("#MFCinfo .glyphicon").not("#MFCinfo .btn-toolbar .glyphicon").toggleClass("glyphicon-triangle-top");
            $("#MFCinfo .glyphicon").not("#MFCinfo .btn-toolbar .glyphicon").animate({opacity:"0"},200);
            $("#MFCinfo .glyphicon").not("#MFCinfo .btn-toolbar .glyphicon").animate({opacity:"1"},1100);
            return false;
        });
    });
</script>
</html>